/**
 * 
 */
package com.alstudio.module.xmpp.protocol.xmpp.util.xmlcreator.iq.props;

import com.alstudio.module.xmpp.protocol.xmpp.packact.ALXmppDomainConfig;
import com.alstudio.module.xmpp.protocol.xmpp.packact.IQNameSpace;
import com.alstudio.module.xmpp.protocol.xmpp.util.xmlcreator.AlXmlTag;
import com.alstudio.module.xmpp.protocol.xmpp.util.xmlcreator.iq.BaseIQTemplate;

/**
 * 生成获取道具价格iq
 * @author alonso lee
 * 
 */
public class CheckPropsPriceIQCreator extends BaseIQTemplate {

	private String props;

	/**
	 * 
	 */
	public CheckPropsPriceIQCreator(String props, String domain) {
		// TODO Auto-generated constructor stub
		this.props = props;
		this.domain = domain;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.alstudio.module.xmpp.protocol.xmpp.util.xmlcreator.iq.BaseIQTemplate
	 * #getIQXml()
	 */
	@Override
	public String getIQXml() {
		// TODO Auto-generated method stub
		mALIQCreator.setNs(IQNameSpace.NS_PROPS_PRICE);
		to = ALXmppDomainConfig.getALXmppDomainConfig().getDomainByNameSpace(
				mALIQCreator.getNs());
		mALIQCreator.setTo(to + domain);
		mALIQCreator.setType(IQ_TYPE_GET);

		AlXmlTag tag = new AlXmlTag("props");
		tag.setText(props);
		tagList.add(tag);

		String xml = "";
		try {
			xml = mALIQCreator.getXml();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		return xml;
	}

}
